﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace landlord2lib
{
    public class HintCardCollection
    {
        private List<Card[]> m_hints;
        private int m_currentHint;

        public HintCardCollection()
        {
            m_hints = new List<Card[]>();
            m_currentHint = 0;
        }

        public void AddHint(Card[] cards)
        {
            m_hints.Add(cards);
        }

        public Card[] NextHintLoop()
        {
            if (m_hints.Count == 0) return null;
            Card[] cards = m_hints[m_currentHint];
            m_currentHint = (m_currentHint + 1) % m_hints.Count;
            return cards;
        }

        public Card[] NextHint()
        {
            if (m_hints.Count == 0) return null;
            if (m_currentHint >= m_hints.Count)
            {
                m_currentHint = 0;
                return null;
            }
            return m_hints[m_currentHint++];
        }

        public HintCardCollection Merge(HintCardCollection src)
        {
            foreach (Card[] cards in src.m_hints) m_hints.Add(cards);
            return this;
        }
    }
}
